﻿using System;
using System.Threading;
using Microsoft.AspNetCore.Mvc.Filters;

namespace WebApplication01.FilterTest
{
    /// <summary>
    /// 为Controller增加自定义返回过滤器
    /// 
    /// </summary>
    public class MyResultFilter : Attribute,IResultFilter
    {
        /// <summary>
        /// 这个 OnResultExecuting 可以改变返回的结果格式
        /// </summary>
        /// <param name="context"></param>
        public void OnResultExecuting(ResultExecutingContext context)
        {
            //throw new NotImplementedException();
            //var result = new ApiResult

            

        }

        public void OnResultExecuted(ResultExecutedContext context)
        {
            //throw new NotImplementedException();
        }
    }
}
